﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst.Configurations
{
    public class UserEnvironmentConfiguration : EntityTypeConfiguration<UserEnvironment>
    {

        public UserEnvironmentConfiguration()
        {
            HasKey(p => p.Id);
            Property(p => p.Username).IsRequired().HasMaxLength(50);

            HasMany(p => p.UserEnvironmentRights)
                .WithRequired(D => D.UserEnvironment)
                .HasForeignKey(d => d.UserEnvironmentId)
                .WillCascadeOnDelete(true);




        }
    }
}
